

 <?php 
 ob_start();
session_start();
require("../conn.php");

   
	  $sqluser =sprintf("select * from tblstudent where Studentid='%s'",$_GET['id']);
      $sqlsection =sprintf("select * from tblclass ");

  $User=mysql_query($sqluser)or die(mysql_error());
  $Section=mysql_query($sqlsection)or die(mysql_error());
 
  
   
?>  
  <script type="text/javascript">
  
function enabledcontrol(control) {
	                   var e = document.getElementById('section_id');
	                 if(control.value==1)
					 {
						
							e.disabled = true;
						var i = 0;
						var n = e.options.length;
						for (i = 0; i < n; i++) {
							e.options[i].disabled = true;
							e.options[i].selected = false;
						}
					 }
					 else
					 {
						 e.disabled = false;
						var i = 0;
						var n = e.options.length;
						for (i = 0; i < n; i++) {
							e.options[i].disabled = false;
							e.options[i].selected = false;
						}
					 }
				}


  function submitt(control)
  {	  
    document.getElementById('temp').value=control.value;
	
	document.formEdit.submit();
  }
  function changevalue(control)
  {	  
     document.getElementById('url').value="article.php?id="+control.value;
  }
  </script>

<div style="font-size:16px;"> 

     <?php if(isset($_GET['id'])) $row=mysql_fetch_assoc($User);  ?>
  <fieldset style="width:90%;">
       
  <legend>Section Detail</legend>
  <form name="detailt" action="Student/savestudent.php" method="POST">
  <p id="field"><span id="text">Tên Sinh viên </span> 
        <input name='StudentID' type="hidden" value="<?php  echo $row['StudentID']; ?>"/>
        <input name="StudentName" type="text"  value="<?php if(isset($_GET['id'])) echo $row['StudentName']; ?>" size="50" />
      </p>
            <p id="field"><span id="text">Mã sinh viên </span> 
       
        <input name="StudentCode" value="<?php if(isset($_GET['id'])) echo $row['StudentCode']; ?>" type="text"  value="" size="50" />
      </p>
    <p id="field"><span id="text">Email </span> 
         
        <input name="StudentEmail" type="text"  value="<?php if(isset($_GET['id'])) echo $row['StudentEmail']; ?>" size="50" />
      </p>
    <p id="field"><span id="text">Số Điện Thoại </span> 
          
        <input name="StudentPhone" type="text"  value="<?php if(isset($_GET['id'])) echo $row['StudentPhone']; ?>" size="50" />
      </p>
    
     
     <?php 
	
	  ?>
    <p id="field"><span id="text">Tên Lớp</span>  
   <select name="ClassID"   id="section_id"   >
               <?php 
								
						while ($rowitem=mysql_fetch_assoc($Section)){  
						?>
                           <option value="<?php echo $rowitem['ClassID']?>"<?php if ($rowitem['ClassID']==$row['ClassID']) echo "selected='selected'"?> ><?php echo $rowitem['ClassName']?></option>
                           <?php		
						} 
						 
						?>
        </select>
             </p>
             </p>
    <p id="field">    
       <label for="button">
         <input type="submit" name="click" value="<?php
	  if(isset($_GET['id']))
	    echo "Save";?>" />
       </label>
      </p>
  </form>
</fieldset>

</div>